import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
  declarations: [],
  imports: [
    CommonModule
  ]
})
export class ArticleModule {}
// 文章类
export class Article{
  title:string;  //标题
  link:string;   //路径
  votes:number   //评分
  constructor(title:string,link:string,votes?:number){
     this.title = title
     this.link = link
     this.votes = votes ||0
  }
  // 点赞
  voteUp(){
    this.votes+=1;
    return false
  }
  // 点踩
  voteDown(){
    this.votes -=1
    return false
  }
}
